#include <iostream>
#include <vector>
class Test
{
public:
    Test()
    {
    }
    Test(const Test &t)
    {
        std::cout << "拷贝构造\n";
    }
    Test(Test &&t)
    {
        std::cout << "移动构造函数:移动语义\n";
    }
};
int main()
{
    Test t1;

    Test t2 = std::move(t1); /*直接夺取内存，无需内存开销*/

    std::vector<int> arr1 = {1, 2, 3};
    std::vector<int> arr2 = std::move(arr1);
    std::cout << "arr1 :" << arr1.size() << "arr2 :" << arr2.size() << std::endl;
    // Test t3 = t2;
    int b = 10;
    /*左值引用*/
    int &a = b;
    /*右值引用*/
    int &&c = 10;
    return 0;
}